import axiosHttp from '@/libs/request';
import { FileInfo } from '@/model';

const upload = (form: FormData) => {
  return axiosHttp.post<FileInfo>('/admin/file/upload', form);
};

const batchUpload = async (form: FormData) => {
  return axiosHttp.post<Array<FileInfo>>('/admin/file/batchUpload', form);
};

/**
 * 删除文件资源
 */
const deleteById = (id: string) => {
  return axiosHttp.delete<void>('/admin/file/delete', { id });
};

export { upload, batchUpload, deleteById };
